package dm1101.demo01;

/**
 * @author Ln
 * @version 终极版
 * @date 2022/11/1 14:50
 */
public class TestSetDaemon {
    public static void main(String[] args) {
        SetDaemon d1 = new SetDaemon();
        d1.setName("线程A");
        d1.setDaemon(true);
        SetDaemon d2 = new SetDaemon();
        d2.setName("线程B");


        d1.start();
        d2.start();
    }
}
class SetDaemon extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println(Thread.currentThread().getName()+"===="+i);
        }
    }
}
